package business.impls.xml;

import org.xml.sax.XMLReader;
import org.xml.sax.SAXException;

import java.io.IOException;
import java.util.HashMap;

/**
 * User: Programmer
 * Date: 12.04.2006
 * Time: 14:21:15
 */
public class XML{
    private Class c = null;
    private XML_Parser sax = null;
    public void prepare() throws ClassNotFoundException, IllegalAccessException, InstantiationException, IOException, SAXException{
        c = Class.forName("org.apache.xerces.parsers.SAXParser");
        XMLReader reader = (XMLReader)c.newInstance();
        sax = new XML_Parser();
        reader.setContentHandler(sax);
        reader.parse("FBSreplace.xml");
    }

    public HashMap<Integer, Integer> getMap() {
        return sax.getMap();
    }

    public Integer getEgCount() {
        return sax.getEgCount();
    }

}
